#ifndef USER_H
#define USER_H

#include <iostream>
#include <string>
#include <vector>
#include <memory>

// 用户基类
class User {
protected:
    int id;
    std::string name;
    std::string password;

public:
    User(int id, const std::string& name, const std::string& password);

    int getId() const;
    std::string getName() const;
    void setName(const std::string& newName);
    std::string getPassword() const;
    void setPassword(const std::string& newPassword);

    virtual void displayInfo() const;
    virtual std::string getType() const = 0;
    virtual std::string serialize() const = 0;

    virtual int getMaxRentCount() const = 0;
    virtual int getMaxRentDuration() const = 0;
};

// 普通客户类
class RegularCustomer : public User {
public:
    RegularCustomer(int id, const std::string& name, const std::string& password);

    void displayInfo() const override;
    std::string getType() const override;
    std::string serialize() const override;

    int getMaxRentCount() const override;
    int getMaxRentDuration() const override;
};

// VIP 客户类
class VIPCustomer : public User {
public:
    VIPCustomer(int id, const std::string& name, const std::string& password);

    void displayInfo() const override;
    std::string getType() const override;
    std::string serialize() const override;

    int getMaxRentCount() const override;
    int getMaxRentDuration() const override;
};

// 管理员类
class Admin : public User {
public:
    Admin(int id, const std::string& name, const std::string& password);

    void displayInfo() const override;
    std::string getType() const override;
    std::string serialize() const override;

    int getMaxRentCount() const override;
    int getMaxRentDuration() const override;
};

// 租赁员类
class RentalStaff : public User {
public:
    RentalStaff(int id, const std::string& name, const std::string& password);

    void displayInfo() const override;
    std::string getType() const override;
    std::string serialize() const override;

    int getMaxRentCount() const override;
    int getMaxRentDuration() const override;
};

#endif // USER_H    